package com.example.spring.common;/**
 * Created by Administrator on 2017-5-25.
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

import javax.validation.Validator;

/**
 * 注入一个验证bean
 * @author thinkGem
 **/
@Configuration
public class LocalValidatorFactory {

    //org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
    @Bean
    public Validator localValidatorFactoryBean() {
        return new LocalValidatorFactoryBean();
    }

}
